package cn.itcast.nems.order.service.impl;

import cn.itcast.nems.common.utils.WrapperUtil;
import cn.itcast.nems.order.dao.entity.JournalRefundFinance;
import cn.itcast.nems.order.dao.mapper.JournalRefundFinanceMapper;
import cn.itcast.nems.order.service.JournalRefundFinanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 退费凭单-财务信息 服务实现类
 * </p>
 *
 * @author 刘曙
 * @since 2024-03-26
 */
@Service
public class JournalRefundFinanceServiceImp extends ServiceImpl<JournalRefundFinanceMapper, JournalRefundFinance> implements JournalRefundFinanceService {

    @Override
    public JournalRefundFinance findByJournalRefundId(String journalRefundId) {
        return   getBaseMapper().selectOne(
                new WrapperUtil<JournalRefundFinance>().limitLaseOne("created_datetime")
                        .eq(JournalRefundFinance::getJournalRefundId ,journalRefundId)
                        .eq(JournalRefundFinance::getDeletedFlag ,false)
        ) ;
    }
}
